const startLoading = page => {
  page.setData({ loading: true })
  const animation = wx.createAnimation({ duration: 60000 });
  animation.rotate(360 * 60).step();
  setTimeout(() => {
    page.setData({
      loadingAnimation: animation.export()
    });
  }, 10);
}

const stopLoading = page => {
  setTimeout(() => {
    page.setData({
      loading: false,
      loadingAnimation: null
    });
  }, 1);
}


module.exports = {
  startLoading: startLoading,
  stopLoading: stopLoading,
}